package work.xiaohong.websocket.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;

@Schema(name = "Friend")
@Data
public class Friend implements Serializable{

    @TableId(value = "id",type = IdType.ASSIGN_ID)
    @Schema(description = "主键id",accessMode = READ_ONLY,required = true)
    private BigInteger id;//主键id

    @Schema(description = "用户id",required = true)
    @TableField("user_id")
    private BigInteger userId;//用户id

    @Schema(description = "好友id",required = true)
    @TableField("friend_id")
    private BigInteger friendId;//好友id

    @Schema(description = "好友分组",required = true)
    @TableField("friend_group")
    private String friendGroup;//好友分组

    @Schema(description = "好友备注",required = true)
    @TableField("remark")
    private String remark;//好友备注

    @Schema(description = "创建时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_create",fill = FieldFill.INSERT)
    private Date gmtCreate;//创建时间

    @Schema(description = "更改时间",accessMode = READ_ONLY)
    @TableField(value = "gmt_modified",fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;//更改时间

    @Schema(description = "乐观锁",accessMode = READ_ONLY)
    @Version
    private Integer version;//乐观锁

    @Schema(description = "逻辑删除标志",accessMode = READ_ONLY)
    @TableLogic
    private Integer deleted;//逻辑删除标志

}

